package com.ss.android.article.base.feature.detail2.picgroup.a;

import android.content.res.Resources;
import android.view.View;
import android.view.animation.Animation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.bytedance.common.utility.UIUtils;
import com.ss.android.action.b.ImpressionHelper;
import com.ss.android.action.b.a;
import com.ss.android.action.b.b;
import com.ss.android.action.b.FeedViewHolder;
import com.ss.android.article.base.app.AppData;
import com.ss.android.article.base.feature.detail.model.ArticleInfo;
import com.ss.android.article.base.feature.detail2.picgroup.GalleryFragment;
import com.ss.android.article.base.feature.detail2.picgroup.view.PictureDetailLayout;
import com.ss.android.article.base.feature.detail2.view.NewDetailActivity;
import com.ss.android.article.base.feature.model.Article;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public final class d implements a {
    public int A;
    public b B;
    public String C;
    public ArticleInfo D;
    private List E;
    public GalleryFragment a;
    public AppData b;
    public Resources c;
    public boolean d;
    public View e;
    public LinearLayout f;
    public View g;
    public View h;
    public View i;
    public TextView j;
    public PictureDetailLayout k;
    public RelativeLayout l;
    public ImageView m;
    public ImageView n;
    public Animation o;
    public Animation p;
    public Animation.AnimationListener q;
    public Animation.AnimationListener r;
    public boolean s;
    public boolean t;
    public boolean u;
    public boolean v;
    public boolean w;
    public int x;
    public int y;
    public boolean z;

    public d(GalleryFragment arg3, Resources arg4, View arg5, View arg6, View.OnClickListener arg7) {

        this.s = false;
        this.t = false;
        this.u = true;
        this.v = false;
        this.w = false;
        this.x = 0;
        this.y = 0;
        this.a = arg3;
        this.b = AppData.getInstance();
        this.e = arg6;
        this.c = arg4;
        this.l = arg5.findViewById(com.ss.android.article.browser.R.id.picture_article_comment_titlebar);
        this.f = arg5.findViewById(com.ss.android.article.browser.R.id.picture_article_write_comment_layout);
        this.g = arg5.findViewById(com.ss.android.article.browser.R.id.picture_article_comment_title_divider);
        com.ss.android.article.base.feature.detail2.config.a.b(this.g);
        this.h = arg5.findViewById(com.ss.android.article.browser.R.id.bottom_listview_layout_title_dividerline);
        this.i = arg5.findViewById(com.ss.android.article.browser.R.id.a7r);
        this.j = arg5.findViewById(com.ss.android.article.browser.R.id.a7s);
        this.m = this.l.findViewById(com.ss.android.article.browser.R.id.a7p);
        this.n = this.l.findViewById(com.ss.android.article.browser.R.id.a7q);
        this.m.setOnClickListener(arg7);
        this.n.setOnClickListener(arg7);
        this.f.setOnClickListener(arg7);
    }

    public final void a(String arg10, List arg11) {
        String v8 = null;
        if(this.B == null && !android.support.design.a.isTextEmpty(arg10)) {
            this.C = arg10;
            this.B = ImpressionHelper.getInstance().a(12, arg10, v8);
        }

        if(this.E == null) {
            this.E = new ArrayList();
            Iterator v1 = arg11.iterator();
            while(v1.hasNext()) {
                Object v0 = v1.next();
                FeedViewHolder v2 = new FeedViewHolder();
                v2.a(37, android.support.design.a.a(((Article)v0).groupId, ((Article)v0).itemId, v8));
                this.E.add(v2);
            }
        }
    }

    public final void a(boolean arg3) {
        int v0 = 0;
        UIUtils.setVisibility(this.f, 0);
        UIUtils.setVisibility(this.l, 0);
        UIUtils.setVisibility(this.g, 0);
        UIUtils.setVisibility(this.h, 0);
        if(this.k != null) {
            PictureDetailLayout v1 = this.k;
            if(arg3) {
                v0 = 8;
            }

            UIUtils.setVisibility(((View)v1), v0);
        }
    }

    public final boolean a() {
        boolean v0 = (this.a.o()) || !this.a.isVisible() || !this.v || (this.s) ? false : true;
        return v0;
    }

    public final boolean a(int arg2, FeedViewHolder arg3) {
        return this.a();
    }

    public final List b() {
        return this.E;
    }

    public final void b(boolean arg4) {
        if(!this.a.o()) {
            this.t = false;
            this.s = false;
            UIUtils.setVisibility(this.e, 8);
            ((NewDetailActivity)this.a.getActivity()).startTitleBarAnimation(false);
            this.d();
            if(this.k != null) {
                this.k.b(true);
            }

            if(!arg4) {
                return;
            }

            ((NewDetailActivity)this.a.getActivity()).mImmersedStatusBarHelper.b(com.ss.android.article.browser.R.color.status_bar_color_gallery);
        }
    }

    public final void c() {
        if(this.q == null) {
            this.q = new com.ss.android.article.base.feature.detail2.picgroup.a.e(this);
        }

        if(this.r == null) {
            this.r = new com.ss.android.article.base.feature.detail2.picgroup.a.f(this);
        }
    }

    public final void d() {
        if(this.B != null) {
            this.B.a(((a)this));
        }
    }

    public final void e() {
        if(this.B != null) {
            this.B.b(((a)this));
        }
    }
}

